<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Array2Table div Demo</title>

</head>

<body>
<h2>Example CSV</h2>
<p>How to create CSV whith ArrayToTable :</p>
<p>I guess doing this manually would't be much more complicated but i just wanted to show how flexible this class can be used </p>

<?php

//Anoter Dataarray whith first line filled whith header data, and last line filled whith footer Data.
$aData = array( 
				array("Name",   "Price", "Number", "Description", "letter", "number"),
				array("rose",   1.25 ,  15, "sometext", "A","1"),
				array("daisy",  0.75 ,  25, "moretext", "b","2"),
				array("orchid", 1.15 ,  7,  "evenmore", "b","3"),
				array("rose2",  1.25 ,  15, "sometext", "v","4"),
				array("daisy3", 0.75 ,  25, "moretext", "c","15"),
				array("orchid4",1.15 ,   7, "evenmore", "d","6"), 
				array("rose2",  1.25 ,  15, "sometext", "v","4"),
				array("daisy3", 0.75 ,  25, "moretext", "c","15"),
				array("orchid4",1.15 ,   7, "evenmore", "d","6") 
); 

// include the Script
include ("classes/arraytotable.php");

// create new tableobject
$oAtt=new ArrayToTable();

// set the main Data Array
$oAtt->aData =$aData;

// set header and footer
$oAtt->sHeadAutoFetch = "keys";

//load empty template
$oAtt->sAlternativTemplate="templates/emptytemplate.php";

// do CSV overrides
$oAtt->aTplOverride['TabColFirst']='"%3$s",';
$oAtt->aTplOverride['TabCol']='"%3$s",';
$oAtt->aTplOverride['TabColLast']='"%3$s"';
$oAtt->aTplOverride['TabRowEnd']='\n\r';  //we use windows \Newline\CarriageReturn here

// Do the actual job
$CSV=$oAtt->Create();



echo "<pre>";
echo $CSV;
echo "</pre>";
//thats it 



?>
</body>
</html>